package cn.stylefeng.guns.modular.business.frequency.appmessage.mapper;

import cn.stylefeng.guns.modular.business.frequency.appmessage.entity.AppMessage;
import cn.stylefeng.guns.modular.business.frequency.appmessage.model.param.AppMessageParam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 系统消息表 Mapper 接口
 *
 * @author 刘耀
 * @date 2022/02/01 11:05
 */
@Repository
public interface AppMessageMapper extends BaseMapper<AppMessage> {


    Page<AppMessage> page(@Param("page") Page<Object> objectPage, @Param("item") AppMessageParam appMessageParam);

    AppMessage detail(@Param("appMessageId") Long appMessageId);

    Integer messageCenter(@Param("userType") Integer userType, @Param("userId") Long userId, @Param("createTime") Date createTime);

    AppMessage newMessage(@Param("userType") Integer userType, @Param("userId") Long userId, @Param("createTime") Date createTime);

    Page<AppMessage> messagePage(@Param("page") Page<Object> objectPage, @Param("userType") Integer userType, @Param("userId") Long userId);

    List<AppMessage> messageList(@Param("list") List<Long> messageIds, @Param("userType") Integer userType, @Param("userId") Long userId);

    Date messageNewTimeByType(@Param("messageType") Integer messageType);

    Page<AppMessage> getPage(@Param("page") Page<Object> defaultPage, @Param("item") AppMessageParam appMessageParam);
    Long getPageNum( @Param("item") AppMessageParam appMessageParam);
}